package com.atguigu.day13.work;

public class Odd extends Thread{
        private int num=1;

    @Override
    public void run() {
        while (true){
            synchronized (Thread.class){
                for (int i=1;i<=5;i++){
                    num+=2;
                    System.out.println("奇数线程第"+i+"个"+num);
                    try {
                        Thread.sleep(500);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
    }
}
